<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCustomServicesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('custom_services', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('service_type')->unsigned()->default(0);
            $table->integer('status')->unsigned()->default(0)->index();
            $table->string('content',150)->default('');
            $table->string('remark',150)->default('');
            $table->integer('user_id')->unsigned()->default(0);
            $table->integer('assign_user_id')->unsigned()->default(0)->index();
            $table->string('assign_user_date',20)->default('');
            $table->string('do_content',150)->default('');
            $table->string('do_time',20)->default('');
            $table->string('result_content',150)->default('');
            $table->integer('happy')->unsigned()->default(0);

            //上一次处理的结果
            $table->integer('last_assign_user_id')->unsigned()->default(0)->index();
            $table->string('last_assign_user_date',20)->default('');
            $table->string('last_do_content',150)->default('');
            $table->string('last_do_time',20)->default('');
            $table->string('last_result_content',150)->default('');
            $table->integer('last_happy')->unsigned()->default(0);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('custom_services');
    }
}
